package com.example.administrator.dc.Bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/8/17.
 */

public class Carousel {

    /**
     * tid : 8
     * title : 东财清新女生伊宸：我是颜色不一样的烟火
     * address : http://mp.weixin.qq.com/s?__biz=MzI3NzA1MjI3OA==&amp;mid=2656595921&amp;idx=1&amp;sn=fb924a09e84d27ab5addfc34ba991293&amp;chksm=f0c0e1c8c7b768de5dfcb0a01369481b73564234194c54de9c706a0727ad98113d2625b31366&amp;mpshare=1&amp;scene=23&amp;srcid=1226UWqbMFvtg
     * isfirst : 1
     * toporder : 1
     * photo : http://118.89.227.169/Public/Uploads/topphotos/20161116220008161.png
     * createtime : 2016-12-26 15:37:53
     */

    private int tid;
    private String title;
    private String address;
    private int isfirst;
    private int toporder;
    private String photo;
    private String createtime;

    public static Carousel objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), Carousel.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setTid(int tid) {
        this.tid = tid;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public void setIsfirst(int isfirst) {
        this.isfirst = isfirst;
    }

    public void setToporder(int toporder) {
        this.toporder = toporder;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public int getTid() {
        return tid;
    }

    public String getTitle() {
        return title;
    }

    public String getAddress() {
        return address;
    }

    public int getIsfirst() {
        return isfirst;
    }

    public int getToporder() {
        return toporder;
    }

    public String getPhoto() {
        return photo;
    }

    public String getCreatetime() {
        return createtime;
    }
}
